g_return_val_if_fail (n_color_stops >= 2, NULL);
g_return_val_if_fail (color_stops[0].offset >= 0, NULL);
for (i = 1; i < n_color_stops; i++)
- {
- g_return_val_if_fail (color_stops[i].offset >= color_stops[i-1].offset, NULL);
-
- }
+ g_return_val_if_fail (color_stops[i].offset >= color_stops[i-1].offset, NULL);
g_return_val_if_fail (color_stops[n_color_stops - 1].offset <= 1, NULL);
self = (GskLinearGradientNode *) gsk_render_node_new (&GSK_LINEAR_GRADIENT_NODE_CLASS, sizeof (GskColorStop) * n_color_stops);
return &self->render_node;
}
+/**
+ * gsk_repeating_linear_gradient_node_new:
+ * @bounds: the rectangle to render the linear gradient into
+ * @start: the point at which the linear gradient will begin
+ * @end: the point at which the linear gradient will finish
+ * @color_stops: a pointer to an array of #GskColorStop defining the gradient
+ * @n_color_stops: the number of elements in @color_stops
+ *
+ * Creates a #GskRenderNode that will create a repeating linear gradient
+ * from the given points and color stops, and render that into the area
+ * given by @bounds.
+ *
+ * Returns: A new #GskRenderNode
+ *
+ * Since: 3.90
+ */
GskRenderNode *
gsk_repeating_linear_gradient_node_new (const graphene_rect_t *bounds,
const graphene_point_t *start,
g_return_val_if_fail (n_color_stops >= 2, NULL);
g_return_val_if_fail (color_stops[0].offset >= 0, NULL);
for (i = 1; i < n_color_stops; i++)
- {
- g_return_val_if_fail (color_stops[i].offset >= color_stops[i-1].offset, NULL);
-
- }
+ g_return_val_if_fail (color_stops[i].offset >= color_stops[i-1].offset, NULL);
g_return_val_if_fail (color_stops[n_color_stops - 1].offset <= 1, NULL);
self = (GskLinearGradientNode *) gsk_render_node_new (&GSK_REPEATING_LINEAR_GRADIENT_NODE_CLASS, sizeof (GskColorStop) * n_color_stops);
return container->n_children;
}
+/**
+ * gsk_container_node_get_child:
+ * @node: a container #GskRenderNode
+ * @idx: the position of the child to get
+ *
+ * Gets one of the children of @container.
+ *
+ * Returns: the @idx'th child of @container
+ *
+ * Since: 3.90
+ */
GskRenderNode *
gsk_container_node_get_child (GskRenderNode *node,
guint idx)
mat[8], mat[9], mat[10], mat[11],
mat[12], mat[13], mat[14], mat[15]
});
-
+
result = gsk_transform_node_new (child, &transform);
gsk_render_node_unref (child);
mat[12], mat[13], mat[14], mat[15]
});
graphene_vec4_init (&offset, vec[0], vec[1], vec[2], vec[3]);
-
+
result = gsk_color_matrix_node_new (child, &matrix, &offset);
gsk_render_node_unref (child);
* Creates a #GskRenderNode that will drawn the @child with reduced
* @color_matrix.
*
- * In particular, the node will transform the operation
+ * In particular, the node will transform the operation
* pixel = color_matrix * pixel + color_offset
* for every pixel.
*
return &self->render_node;
}
+/**
+ * gsk_color_matrix_node_get_child:
+ * @node: a color matrix @GskRenderNode
+ *
+ * Gets the child node that is getting its colors modified by the given @node.
+ *
+ * Returns: (transfer none): The child that is getting its colors modified
+ **/
GskRenderNode *
gsk_color_matrix_node_get_child (GskRenderNode *node)
{
gsk_text_node_deserialize
};
+/**
+ * gsk_text_node_new:
+ * @font: the #PangoFont containing the glyphs
+ * @glyphs: the #PangoGlyphString to render
+ * @color: the foreground color to render with
+ * @x: the x coordinate at which to put the baseline
+ * @y: the y coordinate at wihch to put the baseline
+ *
+ * Creates a render node that renders the given glyphs,
+ * Note that @color may not be used if the font contains
+ * color glyphs.
+ *
+ * Since: 3.92
+ */
GskRenderNode *
gsk_text_node_new (PangoFont *font,
PangoGlyphString *glyphs,
gsk_blur_node_deserialize
};
+/**
+ * gsk_blur_node_new:
+ * @child: the child node to blur
+ * @radius: the blur radius
+ *
+ * Creates a render node that blurs the child.
+ *
+ * Since: 3.92
+ */
GskRenderNode *
gsk_blur_node_new (GskRenderNode *child,
double radius)
* @Short_description: Pixel data uploaded to a #GskRenderer
*
* #GskTexture is the basic element used to refer to pixel data.
+ * It is primarily mean for pixel data that will not change over
+ * multiple frames, and will be used for a long time.
*
* You cannot get your pixel data back once you've uploaded it.
*
static void
gsk_texture_dispose (GObject *object)
-{
+{
GskTexture *self = GSK_TEXTURE (object);
gsk_texture_clear_render_data (self);
{
}
+/**
+ * gsk_texture_new_for_data:
+ * @data: the pixel data
+ * @width: the number of pixels in each row
+ * @height: the number of rows
+ * @stride: the distance from the beginning of one row to the next, in bytes
+ *
+ * Creates a new texture object holding the given data.
+ * The data is assumed to be in CAIRO_FORMAT_ARGB32 format.
+ *
+ * Returns: a new #GskTexture
+ */
GskTexture *
gsk_texture_new_for_data (const guchar *data,
int width,
return texture;
}
+/**
+ * gsk_texture_new_for_surface:
+ * @surface: a cairo image surface
+ *
+ * Creates a new texture object representing the surface.
+ * @surface must be an image surface with format CAIRO_FORMAT_ARGB32.
+ *
+ * Returns: a new #GskTexture
+ */
GskTexture *
gsk_texture_new_for_surface (cairo_surface_t *surface)
{
{
}
+/**
+ * gsk_texture_new_for_pixbuf:
+ * @pixbuf: a #GdkPixbuf
+ *
+ * Creates a new texture object representing the GdkPixbuf.
+ *
+ * Returns: a new #GskTexture
+ */
GskTexture *
gsk_texture_new_for_pixbuf (GdkPixbuf *pixbuf)
{